angular.module('furion.services.data', [])

# 金运通使用中文银行名称
.factory "BankDataJYT", ()->
  optionsData = [
    {id: "MSBCCNBJ", title: "中国民生银行", logo: 'img/banks/mingsheng.png', color: 'bank-cyan'},
    {id: "GDBKCN22", title: "广发银行", logo: 'img/banks/guangfa.png', color: 'bank-red'},
    {id: "ICBKCNBJ", title: "中国工商银行", logo: 'img/banks/gongshang.png', color: 'bank-red'},
    {id: "ABOCCNBJ", title: "中国农业银行", logo: 'img/banks/nongye.png', color: 'bank-green'},
    {id: "BKCHCNBJ", title: "中国银行", logo: 'img/banks/zhonghang.png', color: 'bank-red'},
    {id: "PCBCCNBJ", title: "中国建设银行", logo: 'img/banks/jianshe.png', color: 'bank-blue'},
    {id: "COMMCNSH", title: "交通银行", logo: 'img/banks/jiaotong.png', color: 'bank-blue'},
    {id: "PSBCCNBJ",title: "中国邮政储蓄银行", logo: 'img/banks/youchu.png', color: 'bank-green'},
    {id: "CMBCCNBS", title: "招商银行", logo: 'img/banks/zhaoshang.png', color: 'bank-red'},
    {id: "EVERCNBJ", title: "中国光大银行", logo: 'img/banks/guangda.png', color: 'bank-purple'},
    {id: "FJIBCNBA", title: "兴业银行", logo: 'img/banks/xingye.png', color: 'bank-blue'},
    {id: "SZCBCNBS", title: "平安银行", logo: 'img/banks/pingan.png', color: 'bank-red'},
    {id: "CIBKCNBJ", title: "中信银行", logo: 'img/banks/zhongxin.png', color: 'bank-red'},
    {id: "HXBKCNBJ", title: "华夏银行", logo: 'img/banks/huaxia.png', color: 'bank-red'},
    {id: "SPDBCNSH", title: "浦发银行", logo: 'img/banks/pufa.png', color: 'bank-blue'},
    {id: "BKHDCNB1", title: "邯郸银行", logo: 'img/banks/handan.png', color: 'bank-blue'},
    {id: "LZCBCNBL", title: "兰州银行", logo: 'img/banks/mingsheng', color: 'bank-blue'},
  ]

  obj = {}
  obj.all = optionsData
  obj.getLogo = (cname)->
    for b in optionsData
      return b.logo if b.id == cname
    optionsData[0].logo
  obj.getColor = (cname)->
    for b in optionsData
      return b.color if b.id == cname
    optionsData[0].color

  return obj

.factory "ProvinceCity", ()->
  data = {}
  # data['澳门']=['澳门']
  data['安徽']=["合肥", "芜湖", "蚌埠", "淮南", "马鞍山", "淮北", "铜陵", "安庆", "黄山", "阜阳", "宿州", "滁州", "六安", "宣城", "池州", "亳州"]
  data['北京']=["北京"]
  data['重庆']=["重庆"]
  data['福建']=["福州", "厦门", "漳州", "泉州", "三明", "莆田", "南平", "龙岩", "宁德", "平潭"]
  data['甘肃']=["兰州", "嘉峪关", "金昌", "白银", "天水", "酒泉", "张掖", "武威", "定西", "陇南", "平凉", "庆阳", "临夏", "甘南"]
  data['广东']=["广州", "深圳", "珠海", "汕头", "佛山　　", "韶关", "湛江", "肇庆", "江门", "茂名", "惠州", "梅州", "汕尾", "河源", "阳江", "清远", "东莞", "中山", "潮州", "揭阳", "云浮"]
  data['广西']=["南宁", "柳州", "桂林", "梧州", "北海", "防城港", "钦州", "贵港", "玉林", "百色", "贺州", "河池", "来宾", "崇左"]
  data['贵州']=["贵阳", "六盘水", "遵义", "安顺", "毕节", "铜仁", "黔西", "黔东", "黔南"]
  data['海南']=["海口", "三亚", "儋州", "三沙"]
  data['黑龙江']=["哈尔滨", "齐齐哈尔", "大庆", "鸡西", "鹤岗", "双鸭山", "伊春", "牡丹江", "佳木斯", "七台河", "黑河", "绥化"]
  data['河北']=["石家庄", "唐山", "秦皇岛", "邯郸", "邢台", "保定", "张家口", "承德", "沧州", "廊坊", "衡水"]
  data['河南']=["郑州", "开封", "洛阳", "平顶山", "安阳", "鹤壁", "新乡", "焦作", "濮阳", "许昌", "漯河", "三门峡", "南阳", "商丘", "信阳", "周口", "驻马店"]
  data['湖北']=["武汉", "黄石", "十堰", "宜昌", "襄阳", "鄂州", "荆门", "孝感", "荆州", "黄冈", "咸宁", "随州"]
  data['湖南']=["长沙", "株洲", "湘潭", "衡阳", "邵阳", "岳阳", "常德", "张家界", "益阳", "郴州", "永州", "怀化", "娄底"]
  data['吉林']=["长春", "吉林", "四平", "辽源", "通化", "白山", "松原", "白城"]
  data['江苏']=["南京", "无锡", "徐州", "常州", "苏州", "南通", "连云港", "淮安", "盐城", "扬州", "镇江", "泰州", "宿迁"]
  data['江西']=["南昌", "景德镇", "萍乡", "九江", "新余", "鹰潭", "赣州", "吉安", "宜春", "抚州", "上饶"]
  data['辽宁']=["沈阳", "大连", "鞍山", "抚顺", "本溪", "丹东", "锦州", "营口", "阜新", "辽阳", "盘锦", "铁岭", "朝阳", "葫芦岛"]
  data['内蒙古']=["呼和浩特", "包头", "乌海", "赤峰", "通辽", "鄂尔多斯", "呼伦贝尔", "巴彦淖尔", "乌兰察布"]
  data['宁夏']=["银川", "石嘴山", "吴忠", "固原", "中卫"]
  data['青海']=["西宁", "海东"]
  data['山东']=["济南", "青岛", "淄博", "枣庄", "东营", "烟台", "潍坊", "济宁", "泰安", "威海", "日照", "莱芜", "临沂", "德州", "聊城", "滨州", "菏泽"]
  data['山西']=["太原", "大同", "阳泉", "长治", "晋城", "朔州", "晋中", "运城", "忻州", "临汾", "吕梁"]
  data['陕西']=["西安", "铜川", "宝鸡", "咸阳", "渭南", "汉中", "延安", "榆林", "安康", "商洛"]
  data['上海']=["上海"]
  data['四川']=["成都", "自贡", "攀枝花", "泸州", "德阳", "绵阳", "广元", "遂宁", "内江", "乐山", "南充", "宜宾", "广安", "达州", "眉山", "雅安", "巴中", "资阳"]
  # data['台湾']=
  data['天津']=["天津"]
  data['西藏']=["拉萨", "日喀则", "昌都", "林芝"]
  data['新疆']=["乌鲁木齐", "克拉玛依", "吐鲁番"]
  # data['香港']=
  data['云南']=["昆明", "曲靖", "玉溪", "保山", "昭通", "丽江", "普洱", "临沧"]
  data['浙江']=["杭州", "宁波", "温州", "嘉兴", "湖州", "绍兴", "金华", "衢州", "舟山", "台州", "丽水"]

  obj = {}
  obj.data = data

  obj.getProvinces = () ->
    r = []
    for dtkey in Object.keys(data)
      r.push {id: dtkey, title: dtkey}
    return r

  obj.getCities = (province) ->
    r = []
    for dtkey in data[province]
      r.push {id: dtkey, title: dtkey}
    return r

  return obj

# 附近的朋友
.factory "FriendsInfo", ()->
  obj = {}

  infos = [
    {id: 1001, vname: '小/帅', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'male', level: 9, avatar: 'img/avatar/dynamic/04.jpg'},
    {id: 1002, vname: '等不等到你', msg: '好久没打球了，今天带女票去', distance: '21.3', sex: 'male', level: 5, avatar: 'img/avatar/dynamic/02.jpg'},
    {id: 1003, vname: 'Mr CP', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'female', level: 6, avatar: 'img/avatar/dynamic/13.jpg', da: 'img/activities/dynamic/03.jpg'},
    {id: 1004, vname: '林总', msg: '来来来，约起来', distance: '5.6', sex: 'male', level: 3, avatar: 'img/avatar/dynamic/10.jpg', da: 'img/activities/dynamic/04.jpg'},
    {id: 1005, vname: '你不够懒', msg: '练球时间到，谁来一起啊', distance: '6.2', sex: 'male', level: 7, avatar: 'img/avatar/dynamic/11.jpg'},
    {id: 1006, vname: '时光、', msg: '这个球厉害不', distance: '0.2', sex: 'male', level: 8, avatar: 'img/avatar/dynamic/05.jpg', da: 'img/activities/dynamic/05.jpg'},
    {id: 1007, vname: '小/帅', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'male', level: 9, avatar: 'img/avatar/dynamic/03.jpg'},
    {id: 1008, vname: '等不等到你', msg: '好久没打球了，今天带女票去', distance: '21.3', sex: 'male', level: 5, avatar: 'img/avatar/dynamic/07.jpg'},
    {id: 1009, vname: 'Mr CP', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'female', level: 6, avatar: 'img/avatar/dynamic/08.jpg', da: 'img/activities/dynamic/01.jpg'},
    {id: 1010, vname: '林总', msg: '来来来，约起来', distance: '5.6', sex: 'male', level: 3, avatar: 'img/avatar/dynamic/01.jpg', da: 'img/activities/dynamic/02.jpg'},
    {id: 1011, vname: '你不够懒', msg: '练球时间到，谁来一起啊', distance: '6.2', sex: 'male', level: 7, avatar: 'img/avatar/dynamic/09.jpg'},
    {id: 1012, vname: '时光、', msg: '这个球厉害不', distance: '0.2', sex: 'male', level: 8, avatar: 'img/avatar/dynamic/08.jpg', da: 'img/activities/dynamic/06.jpg'},
    {id: 1013, vname: '小/帅', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'male', level: 9, avatar: 'img/avatar/dynamic/06.jpg'},
    {id: 1014, vname: '等不等到你', msg: '好久没打球了，今天带女票去', distance: '21.3', sex: 'male', level: 5, avatar: 'img/avatar/dynamic/12.jpg'},
    {id: 1015, vname: 'Mr CP', msg: '有没有人一起来打球啊', distance: '0.2', sex: 'female', level: 6, avatar: 'img/avatar/dynamic/03.jpg', da: 'img/activities/dynamic/07.jpg'},
    {id: 1016, vname: '林总', msg: '来来来，约起来', distance: '5.6', sex: 'male', level: 3, avatar: 'img/avatar/dynamic/09.jpg', da: 'img/activities/dynamic/08.jpg'},
    {id: 1017, vname: '你不够懒', msg: '练球时间到，谁来一起啊', distance: '6.2', sex: 'male', level: 7, avatar: 'img/avatar/dynamic/10.jpg'},
    {id: 1018, vname: '时光、', msg: '这个球厉害不', distance: '0.2', sex: 'male', level: 8, avatar: 'img/avatar/dynamic/12.jpg', da: 'img/activities/dynamic/01.jpg'}
  ]

  obj.allD = infos

  obj.getF = (aid)->
    for k in infos
      return k if k.id == parseInt aid
    infos[0]


  return obj

# 附近的球房
.factory "ClubInfo", ()->
  obj = {}

  infos = [
    {id: 2001, vname: '凯歌台球俱乐部', ip: '东风路汇宝大厦4楼', phone: '18736246309', distance: '1.6', level: 3, avatar: 'img/avatar/club/03.jpg', location: {longitude: 113.669485, latitude: 34.806016}},
    {id: 2002, vname: '伯爵台球会所', ip: '文化路东风路交叉口西100米', phone: '18914012049', distance: '3.3', level: 5, avatar: 'img/avatar/club/05.jpg', location: {longitude: 113.672109, latitude: 34.789902}},
    {id: 2003, vname: '皇冠台球会所', ip: '农业路丰庆路北500米路东', phone: '17613468475', distance: '6.7', level: 3, avatar: 'img/avatar/club/01.jpg', da: 'img/activities/club/01.jpg', location: {longitude: 113.657144, latitude: 34.799225}},
    {id: 2004, vname: '绅迪台球', ip: '东风路轻工业学院对面', phone: '18904135334', distance: '5.6', level: 4, avatar: 'img/avatar/club/09.jpg', da: 'img/activities/club/02.jpg', location: {longitude: 113.662549, latitude: 34.806025}},
    {id: 2005, vname: '冠军撞球club', ip: '文化路红旗路交叉口', phone: '13512358653', distance: '8.1', level: 2, avatar: 'img/avatar/club/08.jpg', location: {longitude: 113.673113, latitude: 34.773654}},
    {id: 2006, vname: '乐宝台球俱乐部', ip: '东三街红旗路', phone: '18729822349', distance: '7.8', level: 3, avatar: 'img/avatar/club/13.jpg', da: 'img/activities/club/03.jpg', location: {longitude: 113.664798, latitude: 34.785799}},
    {id: 2007, vname: '凯歌台球俱乐部', ip: '东风路汇宝大厦4楼', phone: '18566253756', distance: '1.6', level: 3, avatar: 'img/avatar/club/11.jpg', location: {longitude: 113.669485, latitude: 34.806016}},
    {id: 2008, vname: '伯爵台球会所', ip: '文化路东风路交叉口西100米', phone: '18927363733', distance: '3.3', level: 5, avatar: 'img/avatar/club/10.jpg', location: {longitude: 113.672109, latitude: 34.789902}},
    {id: 2009, vname: '皇冠台球会所', ip: '农业路丰庆路北500米路东', phone: '0371-23795732', distance: '6.7', level: 3, avatar: 'img/avatar/club/07.jpg', da: 'img/activities/club/04.jpg', location: {longitude: 113.657144, latitude: 34.799225}},
    {id: 2010, vname: '绅迪台球', ip: '东风路轻工业学院对面', distance: '5.6', level: 4, avatar: 'img/avatar/club/13.jpg', da: 'img/activities/club/05.jpg', location: {longitude: 113.662549, latitude: 34.806025}},
    {id: 2011, vname: '冠军撞球club', ip: '文化路红旗路交叉口', phone: '18736843253', distance: '8.1', level: 2, avatar: 'img/avatar/club/12.jpg', location: {longitude: 113.673113, latitude: 34.773654}},
    {id: 2012, vname: '乐宝台球俱乐部', ip: '东三街红旗路', distance: '7.8', level: 3, avatar: 'img/avatar/club/01.jpg', da: 'img/activities/club/06.jpg', location: {longitude: 113.664798, latitude: 34.785799}},
    {id: 2013, vname: '凯歌台球俱乐部', ip: '东风路汇宝大厦4楼', phone: '0371-32975833', distance: '1.6', level: 3, avatar: 'img/activities/club/02.jpg', location: {longitude: 113.669485, latitude: 34.806016}},
    {id: 2014, vname: '伯爵台球会所', ip: '文化路东风路交叉口西100米', distance: '3.3', level: 5, avatar: 'img/avatar/club/07.jpg', location: {longitude: 113.672109, latitude: 34.789902}},
    {id: 2015, vname: '皇冠台球会所', ip: '农业路丰庆路北500米路东', phone: '18736246309', distance: '6.7', level: 3, avatar: 'img/avatar/club/05.jpg', da: 'img/activities/club/07.jpg', location: {longitude: 113.657144, latitude: 34.799225}},
    {id: 2016, vname: '绅迪台球', ip: '东风路轻工业学院对面', phone: '18384936846', distance: '5.6', level: 4, avatar: 'img/avatar/club/08.jpg', da: 'img/activities/club/08.jpg', location: {longitude: 113.662549, latitude: 34.806025}},
    {id: 2017, vname: '冠军撞球club', ip: '文化路红旗路交叉口', phone: '0371-22432234', distance: '8.1', level: 2, avatar: 'img/avatar/club/11.jpg', location: {longitude: 113.673113, latitude: 34.773654}},
    {id: 2018, vname: '乐宝台球俱乐部', ip: '东三街红旗路', distance: '7.8', level: 3, avatar: 'img/avatar/club/05.jpg', da: 'img/activities/club/05.jpg', location: {longitude: 113.664798, latitude: 34.785799}},
  ]

  obj.allD = infos

  obj.getC = (aid)->
    for k in infos
      return k if k.id == parseInt aid
    infos[0]

  return obj

# 相册
.factory "Albums", ()->
  obj = {}

  Imgurl = [
    {id: 3001, url: 'img/album/01.png'},
    {id: 3002, url: 'img/album/02.png'},
    {id: 3003, url: 'img/album/03.png'},
    {id: 3004, url: 'img/album/04.png'},
    {id: 3005, url: 'img/album/05.png'},
    {id: 3006, url: 'img/album/06.png'},
    {id: 3007, url: 'img/album/07.png'},
    {id: 3008, url: 'img/album/08.png'},
    {id: 3009, url: 'img/album/09.png'},
    {id: 3010, url: 'img/album/10.png'},
    {id: 3011, url: 'img/album/11.png'},
    {id: 3012, url: 'img/album/12.png'},
    {id: 3013, url: 'img/album/13.png'},
    {id: 3014, url: 'img/album/14.png'},
    {id: 3015, url: 'img/album/15.png'},
    {id: 3016, url: 'img/album/16.png'},
    {id: 3017, url: 'img/album/17.png'},
    {id: 3018, url: 'img/album/18.png'},
    {id: 3019, url: 'img/album/19.png'},
    {id: 3020, url: 'img/album/20.png'}
  ]

  obj.all = Imgurl

  return obj

# 教程链接
.factory 'Course', ()->
  obj = {}

  links = [
    {id: 4001, title: '【Top+】丁俊晖修正三连传 特朗普暴杆强走位', url:'http://mp.weixin.qq.com/s/J3ZiO0jifuplAjZLWQkiQg', banner_url: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1492677750497&di=3b63ffd63011fa8b28df105027e748d4&imgtype=0&src=http%3A%2F%2Fwww.sh.xinhuanet.com%2F136174144_14909411441991n.jpg'},
    {id: 4002, title: '【Top+】丁俊晖修正三连传 特朗普暴杆强走位', url: 'http://mp.weixin.qq.com/s/J3ZiO0jifuplAjZLWQkiQg', banner_url: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1492679948305&di=1a0401e85854b0227222021827473da5&imgtype=0&src=http%3A%2F%2Fnews.xinhuanet.com%2Fsports%2F2016-03%2F31%2Fmedium-d1a08cba-a591-4135-9fdf-e657ad72f44f1n.jpg'}
  ]

  obj.all = links

  return obj

# 偶像秀
.factory 'Idol', ()->
  obj = {}

  links = [
    {id: 5001, title: '斯诺克幽默感人瞬间集锦', url: 'https://v.qq.com/x/page/i03273u423c.html'},
    {id: 5002, title: '12年大师赛 奥沙利文VS特鲁姆普', url: 'https://v.qq.com/x/page/i03273u423c.html'}
  ]

  obj.all = links

  return obj

# 纪录
.factory 'MyRecords', ()->
  obj = {}

  links = [
    {id: 7001, title: '接清', created_at: '2017/3/12 19:42', detail: '球形散落比较简单，一颗死球，不需要K'},
    {id: 7002, title: '三颗球贴库，清台', created_at: '2017/3/19 21:04', detail: '台面省5颗球，但是有三颗贴库，连K两颗，最后一颗校黑'},
    {id: 7003, title: '炸清', created_at: '2017/3/19 21:39', detail: '炸球效果比较理想，一颗6号下，一颗贴库球留到最后校黑'},
    {id: 7004, title: '炸清', created_at: '2017/3/19 22:17', detail: '炸球效果比较一般，一大一小两颗球下，拼一颗远台上手，一颗死球K出之后留中袋'},
  ]

  obj.all = links
  obj.getR = (aid)->
    for k in links
      return k if k.id == parseInt aid
    links[0]

  return obj

# 提醒
.factory 'MyReminds', ()->
  obj = {}

  links = [
    {id: 8001, title: '下午5点看直播', created_at: '2017/3/14 09:42', detail: '下午5点直播中国公开赛，特鲁姆普'},
    {id: 8002, title: '小胡约球', created_at: '2017/4/03 17:31', detail: '近江打球'},
    {id: 8003, title: '晚上9点看直播', created_at: '2017/4/26 13:03', detail: '世锦赛丁奥大战'},
  ]

  obj.all = links
  obj.getR = (aid)->
    for k in links
      return k if k.id == parseInt aid
    links[0]

  return obj
  